package cn.simon.service;

import cn.simon.mapper.NoticeMapper;
import cn.simon.model.Notice;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;
import java.util.List;

@Log
@Service
public class NoticeService {
    @Autowired
    private NoticeMapper noticeMapper;
    public List<Notice> noticeList(){
        return noticeMapper.selectList(null);
    }


    public Notice findById(Integer id){
        return noticeMapper.selectById(id);
    }
    public int createNotice(Notice notice){
        return noticeMapper.insert(notice);
    }

    public int deleteById(Integer id){
        log.info(id.toString());
        return noticeMapper.deleteById(id);
    }

    public int updateById(Notice notice){
        return noticeMapper.updateById(notice);
    }

}
